package com.ddwl.gate.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @Author hemiaojun
 * @Date 2020/9/24 13:31
 * 第三方充值平台配置
 */
@Component
public class MobileConfigConstant {


    public static final String FIELD_SIGN = "szVerifyString";
    public static final String FIELD_RTN_MSG = "szRtnMsg";
    public static final String FIELD_NOTIFY_URL = "szNotifyUrl";

    public static String USER_ID;

    public static String KEY;
    /**
     * 查询余额接口调用间隔
     */
    public static Integer QUERY_INTERVAL;

    /**
     * 余额阈值
     */
    public static BigDecimal BALANCE_THRESHOLD;

    public final static String SUCCESS = "success";

    public final static String FAILED = "failed";

    /**
     * 回调通知地址
     */
    public final static String NOTIFY_URL = "https://api.zjddwl.com/gate/bohuan/callBack/notify";
    public final static String NOTIFY_URL_TEST = "http://api.test.zjddwl.net/gate/bohuan/callBack/notify";


    /**
     * 运营商不匹配
     */
    public final static Integer OPERATOR_MISMATCH_CODE = 2002;
    /**
     * 京东查询手机运营商接口地址
     */
    public final static String JD_SEARCH_PHONE = "https://chongzhi.jd.com/json/order/search_searchPhone.action?mobile={1}";

    public final static Integer SUCCESS_CODE = 0;

    public final static Integer NOT_TRY_AGAIN=0;
    public final static Integer TRY_AGAIN=1;

    @Value("${bohuan.userId}")
    public void setUserId(String userId){
        USER_ID=userId;
    }
    @Value("${bohuan.key}")
    public void setKey(String key) {
        KEY = key;
    }

    @Value("${bohuan.balance.threshold}")
    public void setBalanceThreshold(BigDecimal balanceThreshold){
        BALANCE_THRESHOLD = balanceThreshold;
    }
    @Value("${bohuan.queryInterval}")
    public void setQueryInterval(Integer queryInterval){
        QUERY_INTERVAL=queryInterval;
    }

}
